<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=7" />
<title>{if isset($SEO['title']) && !empty($SEO['title'])}{$SEO['title']}{/if}{$SEO['site_title']}</title>
<meta name="keywords" content="{$SEO['keyword']}">
<meta name="description" content="{$SEO['description']}">
<link href="{CSS_PATH}style.css" rel="stylesheet" type="text/css" />
<link href="{CSS_PATH}table_form.css" rel="stylesheet" type="text/css" />
<link href="{CSS_PATH}link.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="{JS_PATH}jquery.min.js"></script>
<script type="text/javascript" src="{JS_PATH}formvalidator.js" charset="UTF-8"></script>
<script type="text/javascript" src="{JS_PATH}formvalidatorregex.js" charset="UTF-8"></script>
</head>
<body>
{template "content","header"}
<div class="main center w1024">
    <div class="w980 center">
        <!--left_bar-->
        <div class="col-left">
            <div class="_nav">
                <a href="{siteurl($siteid)}"><b>网站首页</b></a><span> &gt; </span><a href="{APP_PATH}index.php?m={ROUTE_M}&siteid={$siteid}">友情链接</a>
            </div>
            <div class="_cbox">
                <form action="{APP_PATH}index.php?m=link&c=index&a=register&siteid={$siteid}" method="post" name="myform" id="myform">
                    <table width="100%" cellspacing="0" cellpadding="0" class="table_form">
                        <caption class="h34 _title _repx"><div class="_name">申请友情链接</div></caption>
                        <tbody>
                            <tr>
                                <td colspan="2" class="_tips">
                                    <span>链接要求：</span>{pc:block pos="1"}{/pc}
                                </td>
                            </tr>
                            <tr>
                                <th width='120'>链接类型</th>
                                <td>
                                    <input type="radio" onclick="$('#logolink').hide()" checked="checked" value="0" name="linktype" class="radio_style" id="link-pic">
                                    <label for="link-pic">文字链接</label>
                                    &nbsp;&nbsp;
                                    <input type="radio" onclick="$('#logolink').show()" value="1" name="linktype" class="radio_style" id="link-txt">
                                    <label for="link-txt">Logo 链接</label>
                                </td>
                            </tr>
                            <tr>
                                <th>所属分类</th>
                                <td>
                                    <select  style="width: 36%;" id="typeid" name="typeid">
                                        <option value="0">默认分类</option>
                                        {loop $types $type_arr}
                                        <option value="{$type_arr['typeid']}">{$type_arr['name']}</option>
                                        {/loop}
                                    </select>
                                </td>
                            </tr>
                            <tr>
                                <th>网站名称</th>
                                <td>
                                    <input type="text" value="" id="name" name="name" class="input-text">
                                </td>
                            </tr>
                            <tr>
                                <th>网站地址</th>
                                <td>
                                    <input type="text" size="40" value="" name="url" id="url" class="input-text">
                                </td>
                            </tr>
                            <tr style="display: none;" id="logolink">
                                <th>Logo 地址</th>
                                <td>
                                    <input type="text" size="40" value="" name="logo" id="logo" class="input-text">
                                </td>
                            </tr>
                            {if $setting['enablecheckcode']=='1'}
                            <tr>
                                <th>验证码：</th>
                                <td>
                                    <input name="code" type="text" id="code" size="10"  class="input-text"/>
                                    {form::checkcode('code_img','4','14',110,30)}</td>
                            </tr>
                            {/if}
                            <tr>
                                <td colspan="2" height="80" style="padding-left:140px;">
                                    <input type="submit" value=" 申 请 " name="dosubmit" class="button">
                                    <input type="reset" value=" 取 消 " name="reset" class="button">
                                </td>
                            </tr>
                        </tbody>
                    </table>
                </form>
            </div>
        </div>
        <!--right_bar-->
        <div class="col-auto">
            <div class="_rbox">
                <table border="0" width="100%" class="h34 _title">
                    <tr>
                        <td width="25" class="_icon"><img src="{IMG_PATH}web/icon6.png" /></td>
                        <td class="_name">本站 Logo</td>
                        <td align="right" class="_more"></td>
                    </tr>
                </table>
                <div class="_list">
                    <div class="tag_a">
                        <img src="{IMG_PATH}web/logo.gif" /> （规格：88x31px）
                    </div>
                </div>
            </div>
            <div class="bk10"></div>
            <div class="_rbox">
                <table border="0" width="100%" class="h34 _title">
                    <tr>
                        <td width="25" class="_icon"><img src="{IMG_PATH}web/icon6.png" /></td>
                        <td class="_name">合作联系方式</td>
                        <td align="right" class="_more"></td>
                    </tr>
                </table>
                <div class="_list" style="min-height:200px;">
                    <div class="tag_a">
                        {pc:block pos="link-2"}
                        {/pc}
                    </div>
                </div>
            </div>
        </div>
        <div class="_clear"></div>
        {template "content","border-b"}
    </div>
</div>
<script type="text/javascript">
<!--
    $(function(){
    $.formValidator.initConfig({autotip:true,formid:"myform",onerror:function(msg){}});
    $("#name").formValidator({onshow:"请输入网站名称",onfocus:"请输入网站名称"}).inputValidator({min:1,max:999,onerror:"网站名称不能为空"});
     $("#url").formValidator({onshow:"请输入网站网址",onfocus:"请输入网站网址"}).inputValidator({min:1,onerror:"请输入网站网址"}).regexValidator({regexp:"^http:\/\/[A-Za-z0-9]+\.[A-Za-z0-9]+[\/=\?%\-&]*([^<>])*$",onerror:"格式应该为http://www.phpcms.cn/"})
     $("#code").formValidator({onshow:"请输入验证码",onfocus:"验证码不能为空"}).inputValidator({min:1,max:999,onerror:"验证码不能为空"}).ajaxValidator({
        type : "get",
        url : "",
        data :"m=pay&c=deposit&a=public_checkcode",
        datatype : "html",
        async:'false',
        success : function(data){    
            if(data == 1)
            {
                return true;
            }
            else
            {
                return false;
            }
        },
        buttons: $("#dosubmit"),
        onerror : "验证码错误",
        onwait : "验证中"
    });
     })
//-->
</script>
{template "content","footer-min"}
</body>
</html>
